package org.example.lotterysystem.controller.param;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

import java.util.Date;
import java.util.List;

public class DrawPrizeParam {

    /**
     * 活动id
     */
    @NotNull(message = "活动id不能为空！")
    private Long activityId;

    /**
     * 奖品id
     */
    @NotNull(message = "奖品id不能为空！")
    private Long prizeId;


    /**
     * 中奖时间
     */
    @NotNull(message = "中奖时间不能为空！")
    private Date winningTime;

    /**
     * 中奖者列表
     */
    @NotEmpty(message = "中奖者列表不能为空！")
    @Valid
    private List<Winner> winnerList;

    public Long getActivityId() {
        return activityId;
    }

    public void setActivityId(Long activityId) {
        this.activityId = activityId;
    }

    public Long getPrizeId() {
        return prizeId;
    }

    public void setPrizeId(Long prizeId) {
        this.prizeId = prizeId;
    }


    public Date getWinningTime() {
        return winningTime;
    }

    public void setWinningTime(Date winningTime) {
        this.winningTime = winningTime;
    }

    public List<Winner> getWinnerList() {
        return winnerList;
    }

    public void setWinnerList(List<Winner> winnerList) {
        this.winnerList = winnerList;
    }

    public static class Winner{
        /**
         * 中奖者id
         */
        @NotNull(message = "中奖者id不能为空！")
        private Long userId;
        /**
         * 中奖者姓名
         */
        @NotBlank(message = "中奖者姓名不能为空！")
        private String userName;

        public Long getUserId() {
            return userId;
        }

        public void setUserId(Long userId) {
            this.userId = userId;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }
    }

}
